package main.java.io;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class OOSDemo {
    public static void main(String[] args) throws IOException {
        Person p = new Person("张三", 18, "男", new String[]{"学生", "程序员"});
        FileOutputStream fos = new  FileOutputStream("E:\\51_home-work\\homework\\src\\main\\resource\\person.txt");
        ObjectOutputStream oos = new ObjectOutputStream(fos);
        oos.writeObject(p);
        System.out.println("写入完毕");
        oos.close();
    }
}
